<h1>Judge daemons</h1>

<p>A judge daemon is a separate process that compiles and runs programs and comperes them to the reference implementation. The judge daemon communicates with the backand using the filesystem and the MySQL database. A judge daemon runs one submission at a time.</p>

<p>It is very well possible to run multiple judge daemons. Multiple instances of the judge daemon can be spawned on a single machine to make efficient use of multiple processors. When the Justitia directory tree is mounted on multiple machines and all these machines have access to the MySQL database, all these machines can run one or multiple judge daemons.</p>

<p>The judge daemon is located in <tt>JUSTITIA_DIR/backend</tt>.
There are several scripts to run judges:</p>

<dl>
 <dt><tt>judge_once</tt>
 <dd>Starts a judge daemon.
     The daemon sits in a loop, polling for new submissions. When a new submission arrives the daemon will judge it.
     <br>
     When the judge daemon exits (either because of a crash or because of a graceful exit), the script ends.
 
 <dt><tt>judge_forever</tt>
 <dd>Starts a judge daemon. When the daemon exits it is restarted, unless a stop is requested from the web interface.
 
 <dt><tt>try_to_judge_single_submission</tt>
 <dd>Judge a single submission, this is useful for debugging.
 
 <dt><tt>judge_daemon.php</tt>
 <dd>This is the actual judge daemon, writen in PHP. You should never call it directly.
</dl>
